<template>
    <div id="app">
        <div id="container" class="map01">
            <img src="#"/>
        </div>
        <div class="footer">
            <dl class="map02">
                <dt>
                    <h2>
                        <router-link to="/wjw/rmyynq">建湖县人民医院(南院区)</router-link>
                    </h2>
                    <h3>地址：盐城市建湖县城南环路666号</h3>
                </dt>
                <dd>
                    <a id="go1">
                        <img src="@/assets/health-commission/images/dh.png" alt/>
                        去这里
                    </a>
                </dd>
            </dl>

            <dl class="map02">
                <dt>
                    <h2>
                        <router-link to="/wjw/rmyybq">建湖县人民医院(北院区)</router-link>
                    </h2>
                    <h3>地址：盐城市建湖县城汇文东路163号</h3>
                </dt>
                <dd>
                    <a id="go2">
                        <img src="@/assets/health-commission/images/dh.png" alt/>
                        去这里
                    </a>
                </dd>
            </dl>

            <dl class="map02">
                <dt>
                    <h2>
                        <router-link to="/wjw/ey">建湖县第二人民医院</router-link>
                    </h2>
                    <h3>地址：盐城市建湖县上冈镇南沙路65号</h3>
                </dt>
                <dd>
                    <a id="go3">
                        <img src="@/assets/health-commission/images/dh.png" alt/>
                        去这里
                    </a>
                </dd>
            </dl>

            <dl class="map02">
                <dt>
                    <h2>
                        <router-link to="/wjw/sy">建湖县第三人民医院</router-link>
                    </h2>
                    <h3>地址：盐城市建湖县城南京路125号</h3>
                </dt>
                <dd>
                    <a id="go4">
                        <img src="@/assets/health-commission/images/dh.png" alt/>
                        去这里
                    </a>
                </dd>
            </dl>

            <dl class="map02">
                <dt>
                    <h2>
                        <router-link to="/wjw/zyy">建湖县中医院</router-link>
                    </h2>
                    <h3>地址：盐城市建湖县秀夫南路336号</h3>
                </dt>
                <dd>
                    <a id="go5">
                        <img src="@/assets/health-commission/images/dh.png" alt/>
                        去这里
                    </a>
                </dd>
            </dl>
        </div>
    </div>
</template>

<script>
    import * as $ from "@/utils/jquery.min.js";
    import "@/utils/maps.js";


    export default {
        name: "App",
        mounted() {
            const map = new AMap.Map("container", {
                zoom: 12,
                center: [119.779383, 33.431424],
                enableHighAccuracy: true, // 是否使用高精度定位，默认:true
                timeout: 10000, // 超过10秒后停止定位，默认：5s
                buttonPosition: "RB", // 定位按钮的停靠位置
                buttonOffset: new AMap.Pixel(10, 20), // 定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
                zoomToAccuracy: true // 定位成功后是否自动调整地图视野到定位点
            });

            const marker1 = new AMap.Marker({
                title: '建湖县人民医院(南院区)',
                map: map,
                position: [119.779383, 33.431424]
            });
            marker1.on("click", function (e) {
                marker1.markOnAMAP({
                    name: "建湖县人民医院(南院区)",
                    position: map.getCurrentPosition
                });
            });

            $("#go1").on("click", function () {
                marker1.markOnAMAP({
                    name: "建湖县人民医院(南院区)",
                    position: map.getCurrentPosition
                });
            });

            // 北园区
            const marker2 = new AMap.Marker({
                title: '建湖县人民医院(北院区)',
                map: map,
                position: [119.798819, 33.466771]
            });
            marker2.on("click", function () {
                marker1.markOnAMAP({
                    name: "建湖县人民医院(北院区)",
                    position: map.getCurrentPosition
                });
            });

            $("#go2").on("click", function () {
                marker2.markOnAMAP({
                    name: "建湖县人民医院(北院区)",
                    position: map.getCurrentPosition
                });
            });

            // 建湖县第二人民医院
            const marker3 = new AMap.Marker({
                title: "建湖县第二人民医院",
                map: map,
                position: [120.02485, 33.52878]
            });
            marker3.on("click", function () {
                marker3.markOnAMAP({
                    name: "建湖县第二人民医院",
                    position: map.getCurrentPosition
                });
            });

            $("#go3").on("click", function () {
                marker3.markOnAMAP({
                    name: "建湖县第二人民医院",
                    position: map.getCurrentPosition
                });
            });

            // 建湖县第三人民医院
            const marker4 = new AMap.Marker({
                title: "建湖县第三人民医院",
                map: map,
                position: [119.829382, 33.463676]
            });
            marker4.on("click", function () {
                marker4.markOnAMAP({
                    name: "建湖县第三人民医院",
                    position: map.getCurrentPosition
                });
            });

            $("#go4").on("click", function () {
                marker4.markOnAMAP({
                    name: "建湖县第三人民医院",
                    position: map.getCurrentPosition
                });
            });

            // 建湖县中医院
            const marker5 = new AMap.Marker({
                title: "建湖县中医院",
                map: map,
                position: [119.788479, 33.471546]
            });
            marker5.on("click", function () {
                marker5.markOnAMAP({
                    name: "建湖县中医院",
                    position: map.getCurrentPosition
                });
            });

            $("#go5").on("click", function () {
                marker5.markOnAMAP({
                    name: "建湖县中医院",
                    position: map.getCurrentPosition
                });
            });
        }
    };
</script>
<style scoped>
    @import "../../assets/health-commission/css/base.css";
    @import "../../assets/health-commission/css/other.css";
</style>

